/*
 * UserFacade.java
 *
 * Created on 7 de Julho de 2007, 11:29
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package br.com.ecs.presentation.delegate;

import br.com.ecs.persistence.entity.ExpenseType;
import br.com.ecs.persistence.facade.ExpenseTypeFacadeLocal;
import java.util.List;
import javax.ejb.Stateless;

/**
 *
 * @author Danielle
 */
@Stateless
public class ExpenseTypeBusinessDelegate {

    private ExpenseTypeFacadeLocal expenseTypesFacade;
    
    private ExpenseTypeFacadeLocal lookupExpenseTypesFacade() {
        
    try {
        javax.naming.Context c = new javax.naming.InitialContext();
        return (ExpenseTypeFacadeLocal) c.lookup("java:comp/env/br/com/ecs/persistence/ExpenseTypesFacadeLocal");
    }
    catch(javax.naming.NamingException ne) {
        java.util.logging.Logger.getLogger(getClass().
                    getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ne);
        throw new RuntimeException(ne);
    }
}
    
    /** Creates a new instance of UserFacade */
    public ExpenseTypeBusinessDelegate() {
    }

    public void create(ExpenseType expenseTypes) {
        expenseTypesFacade.create(expenseTypes);
    }

    public void edit(ExpenseType expenseTypes) {
        expenseTypesFacade.edit(expenseTypes);
    }

    public void destroy(ExpenseType expenseTypes) {
        expenseTypesFacade.destroy(expenseTypes);
    }

    public ExpenseType find(Object pk) {
        return (ExpenseType) expenseTypesFacade.find(pk);
    }

    public List findAll() {
        return expenseTypesFacade.findAll();
    }
    
}
